package com.huli.service.impl;

import com.huli.mapper.UserMapper;
import com.huli.pojo.SysUser;
import com.huli.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;

    @Override
    public SysUser findUserName(String userName) {
        SysUser sysUser = userMapper.findUserName(userName);
        if (sysUser != null){
            sysUser.setPassword(null);
        }
        return sysUser;
    }

    @Override
    public List<SysUser> findAll() {
        List<SysUser> all = userMapper.findAll();
        return all;
    }
}
